/*
 * Created by JFormDesigner on Fri Jun 28 01:51:00 CST 2024
 */

package scct.hys.ui;

import java.awt.*;
import java.awt.event.*;
import java.lang.management.PlatformLoggingMXBean;
import javax.swing.*;

/**
 * @author 26984
 */
public class FormMain extends JFrame {
    public FormMain() {
        initComponents();
    }

    private void btnUser(ActionEvent e) {
        // TODO add your code here
        PanelUserManger panelUserManger=new PanelUserManger(this);
        panelMain.removeAll();
        panelMain.add(panelUserManger,BorderLayout.CENTER);
        validate();
//        pack();
//        this.validate();
        System.out.println("add panelusermanage");
    }

    private void btnMovie(ActionEvent e) {
        // TODO add your code here
        PanelMovie panelMovie=new PanelMovie(this);
        panelMain.removeAll();
        panelMain.add(panelMovie,BorderLayout.CENTER);
        validate();
    }

    private void btnCinema(ActionEvent e) {
        // TODO add your code here
        PanelCinema panelCinema=new PanelCinema(this);
        panelMain.removeAll();
        panelMain.add(panelCinema,BorderLayout.CENTER);
        validate();
    }

    private void menuItem3(ActionEvent e) {
        // TODO add your code here
    }

    private void btnHall(ActionEvent e) {
        // TODO add your code here
        PanelHall panelHall=new PanelHall(this);
        panelMain.removeAll();
        panelMain.add(panelHall,BorderLayout.CENTER);
        validate();
    }

    private void btnScreening(ActionEvent e) {
        // TODO add your code here
        PanelScreening panelScreening=new PanelScreening(this);
        panelMain.removeAll();
        panelMain.add(panelScreening,BorderLayout.CENTER);
        validate();
    }

    private void orderInformation(ActionEvent e) {
        // TODO add your code here
        PanelOrder panelOrder=new PanelOrder(this);
        panelMain.removeAll();
        panelMain.add(panelOrder,BorderLayout.CENTER);
        validate();
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents  @formatter:off
        // Generated using JFormDesigner Evaluation license - 韩月生
        menuBar1 = new JMenuBar();
        menu1 = new JMenu();
        menuItem1 = new JMenuItem();
        orderInformation = new JMenuItem();
        menu2 = new JMenu();
        menuItem3 = new JMenuItem();
        menuItem4 = new JMenuItem();
        menuItem5 = new JMenuItem();
        menuItem6 = new JMenuItem();
        menu3 = new JMenu();
        menuItem7 = new JMenuItem();
        menuItem8 = new JMenuItem();
        toolBar1 = new JToolBar();
        btnUser = new JButton();
        btnMovie = new JButton();
        btnCinema = new JButton();
        btnHall = new JButton();
        btnScreening = new JButton();
        panelMain = new JPanel();

        //======== this ========
        setTitle("\u5f71\u9662\u7ba1\u7406\u7cfb\u7edf");
        var contentPane = getContentPane();
        contentPane.setLayout(new BorderLayout());

        //======== menuBar1 ========
        {

            //======== menu1 ========
            {
                menu1.setText("\u7cfb\u7edf");

                //---- menuItem1 ----
                menuItem1.setText("\u7ba1\u7406");
                menu1.add(menuItem1);

                //---- orderInformation ----
                orderInformation.setText("\u8d2d\u7968\u4fe1\u606f");
                orderInformation.addActionListener(e -> orderInformation(e));
                menu1.add(orderInformation);
            }
            menuBar1.add(menu1);

            //======== menu2 ========
            {
                menu2.setText("\u7ba1\u7406");

                //---- menuItem3 ----
                menuItem3.setText("\u5f71\u9662\u7ba1\u7406");
                menuItem3.addActionListener(e -> menuItem3(e));
                menu2.add(menuItem3);

                //---- menuItem4 ----
                menuItem4.setText("\u5f71\u7247\u7ba1\u7406");
                menu2.add(menuItem4);

                //---- menuItem5 ----
                menuItem5.setText("\u5ea7\u4f4d\u7ba1\u7406");
                menu2.add(menuItem5);

                //---- menuItem6 ----
                menuItem6.setText("\u653e\u6620\u8ba1\u5212");
                menu2.add(menuItem6);
            }
            menuBar1.add(menu2);

            //======== menu3 ========
            {
                menu3.setText("\u5173\u4e8e");

                //---- menuItem7 ----
                menuItem7.setText("\u6211\u7684\u9879\u76ee");
                menu3.add(menuItem7);

                //---- menuItem8 ----
                menuItem8.setText("text");
                menu3.add(menuItem8);
            }
            menuBar1.add(menu3);
        }
        setJMenuBar(menuBar1);

        //======== toolBar1 ========
        {
            toolBar1.setFloatable(false);

            //---- btnUser ----
            btnUser.setIcon(new ImageIcon(getClass().getResource("/icon/user.png")));
            btnUser.setText("\u7528\u6237\u7ba1\u7406");
            btnUser.addActionListener(e -> btnUser(e));
            toolBar1.add(btnUser);

            //---- btnMovie ----
            btnMovie.setIcon(new ImageIcon(getClass().getResource("/icon/movie.png")));
            btnMovie.setText("\u5f71\u7247\u7ba1\u7406");
            btnMovie.addActionListener(e -> btnMovie(e));
            toolBar1.add(btnMovie);

            //---- btnCinema ----
            btnCinema.setIcon(new ImageIcon(getClass().getResource("/icon/cinema.png")));
            btnCinema.setText("\u5f71\u9662\u7ba1\u7406");
            btnCinema.addActionListener(e -> btnCinema(e));
            toolBar1.add(btnCinema);

            //---- btnHall ----
            btnHall.setIcon(new ImageIcon(getClass().getResource("/icon/seat.png")));
            btnHall.setText("\u5f71\u5385\u7ba1\u7406");
            btnHall.addActionListener(e -> btnHall(e));
            toolBar1.add(btnHall);

            //---- btnScreening ----
            btnScreening.setIcon(new ImageIcon(getClass().getResource("/icon/showtime.png")));
            btnScreening.setText("\u653e\u6620\u8ba1\u5212");
            btnScreening.addActionListener(e -> btnScreening(e));
            toolBar1.add(btnScreening);
        }
        contentPane.add(toolBar1, BorderLayout.NORTH);

        //======== panelMain ========
        {
            panelMain.setBorder(new javax.swing.border.CompoundBorder(new javax.swing.border.TitledBorder(
            new javax.swing.border.EmptyBorder(0,0,0,0), "JFor\u006dDesi\u0067ner \u0045valu\u0061tion"
            ,javax.swing.border.TitledBorder.CENTER,javax.swing.border.TitledBorder.BOTTOM
            ,new java.awt.Font("Dia\u006cog",java.awt.Font.BOLD,12)
            ,java.awt.Color.red),panelMain. getBorder()));panelMain. addPropertyChangeListener(
            new java.beans.PropertyChangeListener(){@Override public void propertyChange(java.beans.PropertyChangeEvent e
            ){if("bord\u0065r".equals(e.getPropertyName()))throw new RuntimeException()
            ;}});
            panelMain.setLayout(new BorderLayout());
        }
        contentPane.add(panelMain, BorderLayout.CENTER);
        setSize(585, 420);
        setLocationRelativeTo(null);
        // JFormDesigner - End of component initialization  //GEN-END:initComponents  @formatter:on
    }



    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables  @formatter:off
    // Generated using JFormDesigner Evaluation license - 韩月生
    private JMenuBar menuBar1;
    private JMenu menu1;
    private JMenuItem menuItem1;
    private JMenuItem orderInformation;
    private JMenu menu2;
    private JMenuItem menuItem3;
    private JMenuItem menuItem4;
    private JMenuItem menuItem5;
    private JMenuItem menuItem6;
    private JMenu menu3;
    private JMenuItem menuItem7;
    private JMenuItem menuItem8;
    private JToolBar toolBar1;
    private JButton btnUser;
    private JButton btnMovie;
    private JButton btnCinema;
    private JButton btnHall;
    private JButton btnScreening;
    private JPanel panelMain;
    // JFormDesigner - End of variables declaration  //GEN-END:variables  @formatter:on
}
